def pps(*args):
    num_list=[len(one) for one in args]#[7,5,5]
    min_index=num_list.index(min(num_list))#1
    str_list=list(args)
    min_str=str_list.pop(min_index)
    #print(str_list,min_str)
    commonality_str_num=list()
    for j in str_list:
        str_num=0
        for i in range(min(num_list)):
            if j[i]==min_str[i]:
                # print(j[i],min_str[i])
                str_num+=1
            else:
                break
        commonality_str_num.append(str_num)
        #print(str_num)    # print(commonality_str_num)
    min_commonality_str_num=min(commonality_str_num)
    if min_commonality_str_num:
        result=min_str[:min_commonality_str_num]
    else:
        result=None
    return result
r=pps('basdsabsde','basdasw','dafsdaas')
print(r)